package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zanr {
   ArrayList a;
   private int c;
   private boolean d;
   byte[] b;
   private boolean e;
   private boolean f = true;
   private boolean g = true;
   private boolean h = false;

   zanr(int var1) {
      this.c = var1;
      this.d = true;
      this.e = true;
   }

   void a(WorksheetCollection var1, Worksheet var2, String var3) {
      int var4;
      if (this.a != null && this.a.size() > 0) {
         for(var4 = 0; var4 < this.a.size(); ++var4) {
            byte[] var5 = (byte[])((byte[])this.a.get(var4));
            if (var5[0] == 4) {
               return;
            }
         }
      }

      var4 = var3.lastIndexOf("!");
      boolean var11 = false;
      boolean var6 = false;
      boolean var7 = true;
      int var8 = var1.u();
      int var12;
      int var14;
      if (var4 == -1) {
         var12 = var1.q().f(var1.u(), 65534, 65534);
         var14 = -1;
      } else {
         String var9 = var3.substring(0, 0 + var4);
         var3 = var3.substring(var4 + 1);
         int[] var10 = zyn.a(var1, var9);
         if (var10 == null) {
            return;
         }

         var12 = var10[0];
         var8 = var10[1];
         var14 = var10[2];
      }

      int var13;
      if (var8 == var1.u()) {
         var13 = var1.getNames().a(var14, var3);
         Name var15 = var1.getNames().get(var13);
         var15.b((int)1);
         var15.b(true);
      } else {
         zbqg var16 = var1.v().a(var8);
         var13 = var16.a(var1, var3);
      }

      byte[] var17 = new byte[]{4, 0, 14, 0, 7, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0};
      byte var18 = 11;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var12), 0, var17, var18, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var13 + 1), 0, var17, var18 + 2, 2);
      this.b = var17;
   }

   String a(WorksheetCollection var1) {
      if (this.a != null && this.a.size() > 0) {
         for(int var2 = 0; var2 < this.a.size(); ++var2) {
            byte[] var3 = (byte[])((byte[])this.a.get(var2));
            if (var3[0] == 4) {
               int var4 = com.aspose.cells.b.a.zc.e(var3, 4) & '\uffff';
               int var5 = 10;
               boolean var6 = false;
               if (var3[var5] == 25 && var3[var5 + 1] == 64) {
                  var5 += 4;
               }

               int var10;
               switch(var3[var5] & 255 & 31) {
               case 3:
                  ++var5;
                  var10 = (com.aspose.cells.b.a.zc.e(var3, var5) & '\uffff') - 1;
                  Name var11 = var1.getNames().get(var10);
                  return "[0]!" + var11.getText();
               case 25:
                  ++var5;
                  int var7 = com.aspose.cells.b.a.zc.e(var3, var5) & '\uffff';
                  var5 += 2;
                  int var8 = var1.q().c(var7);
                  var10 = (com.aspose.cells.b.a.zc.e(var3, var5) & '\uffff') - 1;
                  if (var8 == var1.u()) {
                     Name var12 = var1.getNames().get(var10);
                     return "[0]!" + var12.getText();
                  }

                  zuk var9 = (zuk)var1.v().a(var8).b().get(var10);
                  if (var8 < var1.u()) {
                     ++var8;
                  }

                  return "[" + var8 + "]!" + var9.e();
               }
            }
         }
      }

      return null;
   }

   void a(zanr var1) {
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.f;
      this.g = var1.g;
      if (var1.a != null) {
         this.a = new ArrayList();
         Object var2 = null;
         Iterator var3 = var1.a.iterator();

         while(var3.hasNext()) {
            byte[] var4 = (byte[])var3.next();
            byte[] var5 = new byte[var4.length];
            System.arraycopy(var4, 0, var5, 0, var4.length);
            com.aspose.cells.b.a.a.ze.a(this.a, (Object)var5);
         }
      }

   }

   boolean a() {
      return this.d;
   }

   void a(boolean var1) {
      this.d = var1;
   }

   boolean b() {
      return this.e;
   }

   void b(boolean var1) {
      this.e = var1;
   }

   boolean c() {
      return this.f;
   }

   void c(boolean var1) {
      this.f = var1;
   }

   boolean d() {
      return this.g;
   }

   void d(boolean var1) {
      this.g = var1;
   }

   boolean e() {
      return this.h;
   }

   void e(boolean var1) {
      this.h = var1;
   }

   int f() {
      return this.c;
   }
}
